import axios from "axios";
import qs from "qs";
let instance = axios.create();
const myAxios = {
  get(url, params) {
    return instance({
      method: "get",
      url: url,
      params: params,
    });
  },
  post(url, params) {
    console.log(params);
    return instance({
      method: "post",
      url: url,
      data: qs.stringify(params), //将params对象转换为查询字符串 key=value&key2=values2
    });
  },
};
export default myAxios;
